import common from "@/validator/common";

const name = [
  common.getRequiredRule('班级名'),
  {
    type: 'string',
    min: 2,
    max: 40,
    message: '班级名需在2 - 40个字符之间'
  }
]

const teacherId = [
  common.getRequiredRule('辅导员')
]

const majorId = [
  common.getRequiredRule('所属专业')
]

const grade = [
  common.getRequiredRule('年级'),
  {
    type: 'number',
    min: 1900,
    max: 2100,
    message: '年级不符合规范'
  }
]

export default {
  insertRules: {
    name,
    teacherId,
    majorId,
    grade
  },
  updateRules: {
    name,
    teacherId,
    majorId,
    grade
  }
}
